var GownFullStringTable = Base.extend({
	constructor: null,
	language: null, /* ISO 639-1 */
	get: function(str)
	{
		var s = str;
		if(GownFullStringTable.table[s]) {
			if(GownFullStringTable.table[s] instanceof Array) {
				GownFullStringTable.table[s] = lib.utf16str(GownFullStringTable.table[s]);
				return GownFullStringTable.table[s];
			}
			else return GownFullStringTable.table[s];
		}
		Debug.trace(2,"GownFullStringTable: '%s' does not exist in table.",s);
		return str;
	},
	getv: function(str,argv)
	{
		if(!argv || argv.length < 1) return;

		var i;
		var inm,ret,n,ch;

		str = this.get(str);
		inm = false;
		ret = '';
		for(i=0;i<str.length;i++) {
			ch = str.charAt(i);
			if(ch == '$') {
				if(inm) ret += '$';
				else inm = true;
				continue;
			}
			
			if(inm) {
				n = str.charCodeAt(i) - 48;
				if(n >= 1 && n <= 9) ret += argv[n];
				inm = false;
				continue;
			}
			
			ret += ch;
		}
		return ret;
	},
	table: {}
});

function $GFS(str) { return GownFullStringTable.get(str); }
function $GFSv(str) { return GownFullStringTable.getv(str,arguments); }
